package csc.fresher.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import csc.fresher.bankservice.BankService;
import csc.fresher.domain.History;

@Controller
@RequestMapping(value="/history")
public class HistoryController {

	@Autowired
	private BankService bankService;
	
	@RequestMapping
	public String goHistory(Model model){
		List<History> list = bankService.histories();
		model.addAttribute("histories", list);
		return "history";
	}
}
